package com.biz.primus.base.vo;


import com.biz.primus.base.enums.commodity.IStatus;
import lombok.Data;

import java.io.Serializable;

@Data
public class KeywordWeightVo implements Serializable {

    /**
     * id
     */
    private String id;

    /**
     * 权重配置名称
     */
    private String configName;

    /**
     * 简介
     */
    private String brief;

    /**
     * 删除标识(默认是未删除)
     */
    private Boolean deleteFlag = Boolean.FALSE;

    /**
     * 状态
     */
    private IStatus status;

    /**
     * 关键词搜索相关权重
     */


    /**
     * 品牌名称权重
     */
    private Double brandNameWeight;

    /**
     * 商品名称完全匹配权重
     */
    private Double productNameWeight;

    /**
     * B商品类型权重
     */
    private Double productTypeBWeight;

    /**
     * 门店有库存权重,立即送
     */
    private Double depotHasStockWeight;

    private Double seoTitleWeight;

    private Double seoKeywordsWeight;

    private Double seoDescriptionWeight;


    /**
     * 非关键词搜索权重
     * 默认排序或其他排序时生效
     */


    /**
     * B类商品型权重
     */
    private Double productTypeBSortWeight;

    /**
     * 销量权重  分值等于 权重乘以销量数值
     */
    private Double salesVolumeSortWeight;

    /**
     * 门店有库存权重,立即送
     */
    private Double depotHasStockSortWeight;

    /**
     * 更新时间
     */
    private String updateTime;

    /**
     * 一级过滤搜索条件
     */
    private String firstLevelFilter;

    /**
     * 二级过滤搜索条件
     */
    private String secondLevelFilter;

    private static KeywordWeightVo instance;


    public static KeywordWeightVo getInstance(){
        if (instance == null){
            synchronized (KeywordWeightVo.class){
                if (instance == null){
                    instance = new KeywordWeightVo();
                    instance.defaultInit();
                    return instance;
                }
            }
        }
        return instance;
    }

    /**
     * 默认的权重参数
     */
    public void defaultInit(){
        this.setBrandNameWeight(0.0);
        this.setDepotHasStockSortWeight(0.5);
        this.setDepotHasStockWeight(0.5);
        this.setProductNameWeight(3.0);
        this.setProductTypeBSortWeight(1.0);
        this.setProductTypeBWeight(1.0);
        this.setSalesVolumeSortWeight(1.0);
        this.setSeoTitleWeight(0.0);
        this.setSeoDescriptionWeight(0.0);
        this.setSeoKeywordsWeight(0.0);
        this.setFirstLevelFilter("4<60%");
        this.setSecondLevelFilter("4<60%");
    }
}
